<?php

class PageController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $page = new Application_Model_PageMapper();
        $this->view->entries = $page->fetchAll();
    }

    public function signAction()
    {
        $request = $this->getRequest();
        $form = new Application_Form_Page();

        if($request->isPost()){    
          if($form->isValid($request->getPost())){
            $data = new Application_Model_Page($form->getValues());
            $mapper = new Application_Model_PageMapper();
            $mapper->save($data);
            return $this->helper->redirector('index');
          }
        }

        $this->view->form = $form;
    }


}



